<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('public/header', TEMPLATE_INCLUDEPATH)) : (include template('public/header', TEMPLATE_INCLUDEPATH));?>
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('public/comhead', TEMPLATE_INCLUDEPATH)) : (include template('public/comhead', TEMPLATE_INCLUDEPATH));?>
<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun/template/public/ygcss.css">
<style>
    .layui-form-label{width:120px}
</style>

<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li class="active"><a href="javascript:void(0);">套餐添加</a></li>
</ul>

<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <!--<div class="layui-form-item">-->
            <!--<label class="layui-form-label">套餐类型</label>-->
            <!--<div class="col-sm-10">-->
                <!--<input type="radio" value="1" name="type" <?php  if($info['type']==1 || empty($info['type'])) { ?>checked<?php  } ?> >工作日-->
                <!--<input type="radio" value="2" name="type" <?php  if($info['type']==2) { ?>checked<?php  } ?> >节假日/周末-->
                <!--<input type="radio" value="3" name="type" <?php  if($info['type']==3) { ?>checked<?php  } ?>>周租-->
                <!--<input type="radio" value="4" name="type" <?php  if($info['type']==4) { ?>checked<?php  } ?>>月租-->
                <!--<input type="radio" value="5" name="type" <?php  if($info['type']==5) { ?>checked<?php  } ?>>年租-->
            <!--</div>-->
        <!--</div>-->
        <div class="layui-form-item">
            <label class="layui-form-label">套餐名称</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="name" value="<?php  echo $info['name'];?>" maxlength="10" placeholder="如：3日套餐，名称最多10个字"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">天数</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="number" name="day" value="<?php  echo $info['day'];?>"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">可省价格百分比</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="number" name="money" value="<?php  echo $info['money'];?>" placeholder="单位%，填写整数" onblur="nums()" id="num"/>
            </div>
        </div>
        <div class="form-group">

            <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #444444;margin-left: 550px;"/>

            <input type="hidden" name="token" value="<?php  echo $_W['token'];?>" />
            <input type="hidden" name="id" value="<?php  echo $info['id'];?>" />

        </div>


    </form>
</div>

<script type="text/javascript">
    function nums(){
        var num=$('#num').val();
        var r = /^\+?[1-9][0-9]*$/;
        var res=r.test(num);
       if(res==false){
           alert('请输入正整数');
           return false;
       }

    }
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#astime',
            type: 'datetime'
        });
        laydate.render({
            elem: '#antime',
            type: 'datetime'
        });
    });

    layui.use('form', function () {
        var form = layui.form;
        form.render();
        form.on('radio(type)', function (data) {
            if (this.value == 1) {
                $('#cash').hide()
                $('#discount').show()
            } else {
                $('#discount').hide()
                $('#cash').show()
            }
        })

    });
</script>

<script type="text/javascript">
    $(function () {
        $("#frame-4").show();
        $("#yframe-4").addClass("wyactive");

    })

    function reload() {
        //提交租车券数据表单之后对页面进行刷新,放置重复提交
        window.location.reload();

    }
</script>